<?php
/*
 * File: example.php
 * Description: Received Mail Example
 * Created: 01-03-2006
 * Author: Mitul Koradia
 * Email: mitulkoradia@gmail.com
 * Cell : +91 9825273322
 */
include("receivemail.class.php");
// Creating a object of reciveMail Class
$obj= new receiveMail('aidalit.hernandez@adapare.mx','Enconfianza123','aidalit.hernandez@adapare.mx','mail.adapare.mx','pop3','110',false);
$obj->connect();         //If connection fails give error message and exit
// Get Total Number of Unread Email in mail box
$tot=$obj->getTotalMails(); //Total Mails in Inbox Return integer value


?>
<div id="container">
<div id="logo"><h2 style="color:#FFF;">Ver Correo</h2></div>
<table  width="90%"  border="1">
<?php

	$head=$obj->getHeaders($_GET['mail']);  // Get Header Info Return Array Of Headers **Array Keys are (subject,to,toOth,toNameOth,from,fromName)
	?>
    <tr><td align="left"><?php echo "<b>T&iacute;tulo: </b>".$head['subject'];?><br/>
	<?php echo "<b>TO:</b> ".$head['to'];?><br/>
	<?php //secho "To Other :: ".$head['toOth'];?>
    <?php //echo "ToName Other :: ".$head['toNameOth'];?>
	<?php echo "<b>De:</b> ".$head['fromName']." < ".$head['from'];?> ><br/>
	<?php echo "<b>Asunto:</b> ".$obj->getBody($_GET['mail']);  // Get Body Of Mail number Return String Get Mail id in interger
	
	/*
	$str=$obj->GetAttach($i,"./"); // Get attached File from Mail Return name of file in comma separated string  args. (mailid, Path to store file)
	$ar=explode(",",$str);
	foreach($ar as $key=>$value)
		echo ($value=="")?"":"Atteched File :: ".$value."<br>";
		*/
	?>  <br/>  <a href="javascript:llamarasincrono('ticket/producto_categoria1.php?id=1&name=<?php echo $head['fromName'];?>&mail=<?php echo $head['from'];?>','cuadroprincipal',{numero:0});"> Abrir Ticket</a>
</td></tr><?php 
	
	//$obj->deleteMails($i); // Delete Mail from Mail box

$obj->close_mailbox();   //Close Mail Box

?>
</table>
</div>